package cn.iocoder.yudao.module.dlbz.dal.mysql.companyscorerule;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.dlbz.dal.dataobject.companyscorerule.CompanyScoreRuleDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.dlbz.controller.admin.companyscorerule.vo.*;

/**
 * 企业积分发放规则 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface CompanyScoreRuleMapper extends BaseMapperX<CompanyScoreRuleDO> {

    default PageResult<CompanyScoreRuleDO> selectPage(CompanyScoreRulePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CompanyScoreRuleDO>()
                .eqIfPresent(CompanyScoreRuleDO::getCompanyId, reqVO.getCompanyId())
                .eqIfPresent(CompanyScoreRuleDO::getPostId, reqVO.getPostId())
                .likeIfPresent(CompanyScoreRuleDO::getPostName, reqVO.getPostName())
                .eqIfPresent(CompanyScoreRuleDO::getPk, reqVO.getPk())
                .eqIfPresent(CompanyScoreRuleDO::getIntro, reqVO.getIntro())
                .eqIfPresent(CompanyScoreRuleDO::getScore, reqVO.getScore())
                .betweenIfPresent(CompanyScoreRuleDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CompanyScoreRuleDO::getId));
    }

}